import Vue from 'vue'
import Router from 'vue-router'
import index from 'components/index'
import allClass from 'components/allClass'
import search from 'components/search'
import detial from 'components/itemDetial'
import pay from 'components/pay'
import shop_car from 'components/shop_car'
import my from 'components/my'
import orderConfirm from 'components/orderConfirm'
import myOrder from 'components/myOrder'
import myOrders from 'components/myOrders'
import orderDetial from 'components/orderDetial'
import admin from 'components/admin'
import setUser from 'components/setUser'
import address_admin from 'components/address_admin'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/index'
    },
    {
      path: '/index',
      component: index,
      children: [
        {
          path: 'detial',
          component: detial
        }
      ]
    },
    {
      path: '/allClass',
      component: allClass,
      children: [
        {
          path: 'detial',
          component: detial
        }
      ]
    },
    {
      path: '/search',
      component: search,
      children: [
        {
          path: 'detial',
          component: detial
        }
      ]
    },
    {
      path: '/pay',
      component: pay
    },
    {
      path: '/shop_car',
      component: shop_car,
      children: [
        {
          path: 'detial',
          component: detial
        }
      ]
    },
    {
      path: '/myOrder',
      component: myOrder,
      children: [
        {
          path: 'orderDetial',
          component: orderDetial
        }
      ]
    },
    {
      path: '/myOrders',
      component: myOrders,
      children: [
        {
          path: 'orderDetial',
          component: orderDetial
        }
      ]
    },
    {
      path: '/my',
      component: my,
    },
    {
      path: '/orderConfirm',
      component: orderConfirm
    }, {
      path: '/admin',
      component: admin
    }, {
      path: '/setUser',
      component: setUser
    }, {
      path: '/address_admin',
      component: address_admin
    }
  ]
})
